Regional Attributes

Regions let you use different product attributes such as list price, sale price, catalog names, and availability for groups of users. Typically, these users are from one geographic area or region-for example, an international retailer could set up one region for each country where they do business. (Regions can be used more abstractly so long as the basic requirements are met.)

To add region support, you need to:

  1. Inform your Algonomy team, they will enable regions for your site.

  2. Update your feed. The variable values are sent through the feed and associated to a region ID. See Product Region Flat File Feed for a complete list of attributes that you can set for a region.

  3. Update your site integration. In the integration logic, you only identify the user’s region ID. When the region ID is known for a user, the recommendations that are returned use the available values for that region.

Notes:

  • The user does not need to be logged in.

  • Region ID can vary during a session.

  • If the feed didn’t contain region-specific data for a particular product, the recommendation shows the default product data.

Regions and Recommendations

In general, region data does not change the recommendations that are returned (except for products that are out of stock in certain regions). Regional information is substituted after recommendations are generated for a user. Backfill strategies become especially important when you’re working with sites with multiple regions.

Languages

The language will be deduced by the region, as set in the region feed file.

For example, you could set up a country like Switzerland with 3 regions and 3 languages:

 

RegionId ch-FR, Region: Switzerland-France, Language-tag: ch-FR

RegionId ch-DE,Region: Switzerland-Germany, Language-tag: ch-DE

RegionId ch-IT, Region: Switzerland-Italy, Language-tag: ch-IT

JavaScript Integration

How to make this code work for you

Add the following lines of code to your page tags, adding the required information to them:

Function

Requirement

R3_COMMON.setRegionId('Region ID');

Replace Region ID with the ID that represents the current customer's region. The set of valid region IDs are determined by you and set up in the region feed.

Sample Code

Call setRegionId() in the Primary Code Block.

Primary Code Block

Copy
<!-- Place this code inside the <body> element as close to the top as possible -->
<script charset="utf-8" type="text/javascript">
  var R3_COMMON = new r3_common();
  R3_COMMON.setApiKey('abcd5432e1');
  R3_COMMON.setBaseUrl(window.location.protocol+'//integration.richrelevance.com/rrserver/');
  R3_COMMON.setClickthruServer(window.location.protocol+"//"+window.location.host);
  R3_COMMON.setSessionId('6B4D397B');
  R3_COMMON.setUserId('10987');  // if no user ID is available, please leave this blank

  // Use this code if you are not requesting placement(s) for personalization
  R3_COMMON.addPlacementType('home_page');

  // Replace placement_name with the placement name you set up in Dashboard.
  // Call multiple times to display more than one placement.
  R3_COMMON.addPlacementType('home_page.placement_name');
  
  // Send the region identifier for Switzerland, French area
  R3_COMMON.setRegionId('ch-FR');
  
  var R3_HOME = new r3_home();
  rr_flush_onload();
  r3();
</script> 

APIs

Set the region ID with the rid parameter in recsForPlacements.

Example: ​rid=ch-FR